<template>
  <view class="container">
    <view class="header">❤️ 我的收藏</view>

    <scroll-view scroll-y class="scroll-area">
      <view
        class="card"
        v-for="(item, index) in favoriteList"
        :key="index"
      >
        <view class="card-header">
          <text class="title">{{ item.deviceName }}</text>
          <text class="number">设备编号：{{ item.deviceId }}</text>
        </view>
        <view class="card-body">
          <text class="location">📍 {{ item.location }}</text>
          <text class="time">收藏时间：{{ item.time }}</text>
        </view>
      </view>
    </scroll-view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      favoriteList: [
        {
          deviceName: "1号楼-A梯",
          deviceId: "DT20230815001",
          location: "浙江省金华市东阳市人民路89号",
          time: "2025-07-31 14:20"
        },
        {
          deviceName: "行政楼-B梯",
          deviceId: "DT20230511023",
          location: "永康市行政中心3号楼",
          time: "2025-07-22 09:05"
        },
        {
          deviceName: "车库-C梯",
          deviceId: "DT20230402005",
          location: "东阳人民医院地下停车场",
          time: "2025-07-10 16:30"
        }
      ]
    };
  }
};
</script>

<style scoped>
.container {
  background-color: #f5f5f5;
  min-height: 100vh;
  padding: 30rpx;
}

.header {
  font-size: 40rpx;
  font-weight: bold;
  text-align: center;
  margin-bottom: 30rpx;
}

.scroll-area {
  max-height: calc(100vh - 100rpx);
}

.card {
  background-color: #ffffff;
  border-radius: 16rpx;
  padding: 24rpx;
  margin-bottom: 24rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10rpx;
}

.title {
  font-size: 32rpx;
  font-weight: 600;
  color: #333;
}

.number {
  font-size: 26rpx;
  color: #999;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10rpx;
}

.location {
  font-size: 28rpx;
  color: #555;
}

.time {
  font-size: 26rpx;
  color: #999;
}
</style>
